home *** CD-ROM | disk | FTP | other *** search
- Path: solon.com!not-for-mail
- From: chuckh@ix.netcom.com (Chuck Hamilton)
- Newsgroups: comp.lang.c,comp.lang.c.moderated,hp.unix,comp.sys.hp.apps,comp.sys.hp.hpux
- Subject: Re: C coding problem
- Date: 4 Apr 1996 18:37:22 -0600
- Organization: Mercy Health Plan
- Sender: clc@solutions.solon.com
- Approved: clc@solutions.solon.com
- Message-ID: <4k1q02$57m@solutions.solon.com>
- References: <4ianbf$h86@solutions.solon.com> <4iemcl$a05@solutions.solon.com> <4io1io$no4@solutions.solon.com> <4j06na$808@solutions.solon.com> <4jttan$3gf@solutions.solon.com> <4jv6st$crf@solutions.solon.com>
- NNTP-Posting-Host: solutions.solon.com
- X-NETCOM-Date: Thu Apr 04 6:43:56 AM PST 1996
- X-Newsreader: Forte Agent .99d/16.182
-
- schwarz@mips.complang.tuwien.ac.at (Konrad Schwarz) wrote:
-
- >|> a[i] is converted to *(a + i) by the compiler in any case so
- >|> whats the advantage with your approach?
- >
- >The machine doesn't have to add, the machine doesn't have to multiply,
- >*a is less complicated to understand than a [i] since only one variable
- >is involved, *a is more type safe than a [i], since there is nothing
- >constraining i (besides it being of integral type), the optimizer
- >has less to do, compile time decreases, etc.
- >
- >Why use C if you're uncomfortable with pointer arithmetic? Why use
- >functional languages if you're uncomfortable with recursion? Why use
- >object-oriented languages if you're uncomfortable with objects?
- >
- >Konrad Schwarz
-
- Why not use i[a] and _really_ confuse the hell out of 'em?
- <smile>
-
- I've been following this thread for a few days and just had to say
- something. Personally I agree with you. The language is well defined.
- If a programmer can't understand it's rules and constructs he should
- be programming in another language. And if he doesn't understand the
- relationships between pointers and arrays he most certainly shouldn't
- be programming in C. That _is_ the strength of the language.
- --
- Chuck Hamilton
- chuckh@ix.netcom.com
-
- If at first you don't succeed, skydiving isn't for you.
-